#pragma once

#ifndef ENTITYMANAGER_H
#define ENTITYMANAGER_H

#include <map>
#include <list>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#include "Entity.h"
#include "Core.h"

class EntityManager
{
private:
	static int nextID;
	static std::map<int, Entity*> entities;
	static std::map<std::string, std::list<Entity*>>namedEntities;
	EntityManager();
	~EntityManager();
	static EntityManager* instance;

public:
	static void init();
	static void update(float frameTime);
	static void draw(ID3DXSprite* sprite);
	static void registerEntity(Entity* entity);
	static void removeEntity(Entity* entity);
	static Entity* getEntity(int id);
	static std::list<Entity*>* getNamedEntities(std::string name);
};

#endif